package MyTest;

import java.util.Scanner;

public class T4 {
    public static void main(String[] args) {
        //输入
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        int left=scanner.nextInt();
        int right=scanner.nextInt();

        //建立dp[]
        String[] dp = new String[N+1];
        dp[1] = "1";
        dp[2] = "101";
        dp[3] = "111";
        for(int i=4; i<=N; i++){
            dp[i] = dp[i/2] + String.valueOf(i%2) + dp[i/2];

        }
        for(int j=1; j<=20; j++){
            System.out.println(j + ":" + dp[j]);
        }
        //        System.out.println(dp[N]);
        int count = 0;
        for(int i=left-1; i<=right-1; i++){
            count += dp[N].charAt(i) - '0';
        }
        System.out.println(count);
    }
}
